body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    color: #e0e0e0;
    font-family: 'Segoe UI', 'Arial', sans-serif;
}

#container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#renderCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 400px;
    background: rgba(8, 12, 16, 0.95);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(64, 128, 255, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    color: #e8e8e8;
    font-size: 13px;
}

.ui-header {
    background: linear-gradient(135deg, rgba(24, 36, 48, 0.95), rgba(16, 24, 32, 0.95));
    padding: 12px 16px;
    border-bottom: 1px solid rgba(64, 128, 255, 0.2);
}

.ui-header h1 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 400;
    color: #fff;
    text-align: center;
}

.ui-tabs {
    display: flex;
    gap: 2px;
    flex-wrap: wrap;
}

.tab-button {
    flex: 1;
    min-width: 60px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    text-align: center;
    margin-bottom: 2px;
}

.tab-button:hover {
    background: rgba(64, 128, 255, 0.2);
    border-color: rgba(64, 128, 255, 0.4);
    color: #fff;
}

.tab-button.active {
    background: rgba(64, 128, 255, 0.4);
    border-color: rgba(64, 128, 255, 0.6);
    color: #fff;
}

.tab-content {
    display: none;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 16px;
}

.tab-content.active {
    display: block;
}

.control-section {
    margin-bottom: 20px;
    background: rgba(16, 24, 32, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 12px;
}

.control-section h2 {
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(64, 128, 255, 0.3);
}

.control-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    gap: 12px;
}

.control-group label {
    min-width: 110px;
    font-size: 12px;
    color: #ccc;
}

.control-group input[type="range"] {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    -webkit-appearance: none;
    outline: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: linear-gradient(135deg, #4080ff, #60a0ff);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(64, 128, 255, 0.3);
}

.control-group input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(64, 128, 255, 0.5);
}

.control-group input[type="text"] {
    flex: 1;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    font-size: 12px;
}

.control-group input[type="text"]:focus {
    outline: none;
    border-color: rgba(64, 128, 255, 0.6);
    background: rgba(255, 255, 255, 0.15);
}

.control-group span {
    min-width: 45px;
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #aaa;
}

.color-control {
    flex-direction: column;
    align-items: flex-start;
}

.color-sliders {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.color-preview {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 6px;
}

.color-slider {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-slider span:first-child {
    min-width: 15px;
    text-align: right;
    font-size: 11px;
}

.color-slider input[type="range"] {
    flex: 1;
}

.color-slider span:last-child {
    min-width: 35px;
    text-align: right;
    font-family: 'Courier New', monospace;
    font-size: 10px;
}

.xyz-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.xyz-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.xyz-control span:first-child {
    min-width: 15px;
    font-size: 11px;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(64, 128, 255, 0.2), rgba(32, 96, 255, 0.2));
    border: 1px solid rgba(64, 128, 255, 0.4);
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    text-align: left;
}

.action-button:hover {
    background: linear-gradient(135deg, rgba(64, 128, 255, 0.3), rgba(32, 96, 255, 0.3));
    border-color: rgba(64, 128, 255, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(64, 128, 255, 0.2);
}

.action-button .icon {
    font-size: 16px;
}

.player-list, .planet-gallery {
    max-height: 200px;
    overflow-y: auto;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.player-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #4080ff;
}

.player-name {
    flex: 1;
    font-size: 12px;
    color: #ccc;
}

.planet-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.planet-item:hover {
    background: rgba(64, 128, 255, 0.1);
    border-color: rgba(64, 128, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(64, 128, 255, 0.2);
}

.planet-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(45deg, #4080ff, #60a0ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.planet-info {
    flex: 1;
    min-width: 0;
}

.planet-name {
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.planet-author {
    font-size: 10px;
    color: #888;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loading-text {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 20px;
}

.tab-content::-webkit-scrollbar,
.player-list::-webkit-scrollbar,
.planet-gallery::-webkit-scrollbar {
    width: 6px;
}

.tab-content::-webkit-scrollbar-track,
.player-list::-webkit-scrollbar-track,
.planet-gallery::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb,
.player-list::-webkit-scrollbar-thumb,
.planet-gallery::-webkit-scrollbar-thumb {
    background: rgba(64, 128, 255, 0.3);
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb:hover,
.player-list::-webkit-scrollbar-thumb:hover,
.planet-gallery::-webkit-scrollbar-thumb:hover {
    background: rgba(64, 128, 255, 0.5);
}

@media (max-width: 768px) {
    #ui {
        width: calc(100vw - 40px);
        right: 20px;
        font-size: 12px;
    }
    
    .control-group label {
        min-width: 90px;
        font-size: 11px;
    }
    
    .tab-button {
        font-size: 10px;
        padding: 5px 6px;
    }
}